clk: bcm2835: Minimise clock jitter for PCM clock
authorPhil Elwell <phil@raspberrypi.org>
Mon, 22 May 2017 12:56:41 +0000 (13:56 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:37:53 +0000 (17:37 +0000)
commit9ffb605c6c16146d0c088ca78ef99d1781517c18
treecc63b5390248fb8bdb806046201fdf9a4495fd15
parentdf0b1386e90c9292101b68749333ebd1a6b0bd14
clk: bcm2835: Minimise clock jitter for PCM clock

Fractional clock dividers generate accurate average frequencies but
with jitter, particularly when the integer divisor is small.

Introduce a new metric of clock accuracy to penalise clocks with a good
average but worse jitter compared to clocks with an average which is no
better but with lower jitter. The metric is the ideal rate minus the
worse deviation from that ideal using the nearest integer divisors.

Use this metric for parent selection for clocks requiring low jitter
(currently just PCM).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/clk/bcm/clk-bcm2835.c